/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package exception;

import modele.Insurance;

/**
 *
 * @author Alex
 */
public class InsuranceExists extends Exception {
    protected Insurance insurance;
    
    public InsuranceExists(Insurance insurance) {
        this.insurance = insurance;
    }

    public String toString() {
        return "An insurance for the car registered as '" +
                insurance.getCarRegistration() + "' already exists.";
    }
    
    
    
}
